<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>ECharts</title>
    <!-- 引入刚刚下载的 ECharts 文件 -->
    <script src="./js/echarts.min.js"></script>
  </head>
  <body>
    <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
    <div id="main" style="width: 750px; height: 600px"></div>
    <script type="text/javascript">
      // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.getElementById("main"));

      // 指定图表的配置项和数据
      option = {
        title: {
          text: "班级薪资分布",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          bottom: "0%",
          left: "center",
        },
        series: [
          {
            name: "班级薪资分布",
            type: "pie",
            radius: ["60%", "70%"],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 10,
              borderColor: "#fff",
              borderWidth: 2,
            },
            label: {
              show: false,
              position: "center",
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 40,
                fontWeight: "bold",
              },
            },
            labelLine: {
              show: false,
            },
            data: [
              { value: 1048, name: "1万以下" },
              { value: 735, name: "1-1.5万" },
              { value: 580, name: " 1.5-2万" },
              { value: 484, name: "2万以上" },
            ],
          },
        ],
      };
      myChart.setOption(option);
      // 使用刚指定的配置项和数据显示图表。
    </script>
  </body>
</html>
